<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddIndexToProfitSharingListTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('profit_sharing_list', function (Blueprint $table) {
            $table->index(['channel', 'trans_id', 'profit_sharing_order_id'], 'c_t_p');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('profit_sharing_list', function (Blueprint $table) {
            $table->dropIndex(['channel', 'trans_id', 'profit_sharing_order_id']);
        });
    }
}
